This invention relates generally to distributed computer systems, and more particularly to arbitrating changes in state for entities shared among such distributed computer systems.
A portion of the disclosure of this patent contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. The following notice applies to the software and data as described below and in the drawings hereto: Copyright (copyright) 1998, Microsoft(copyright) Corporation, All Rights Reserved.
In a network in which multiple computers each process changes against the state of a shared entity, there must be a mechanism through which the computers cooperate when making the changes in such a way that all the computers come to the same decision about how the state should be changed. Locking and other synchronization primitives provide a way for multiple threads to coordinate changes to the same entity on the same computer. Across networked computers, however, some other synchronization mechanism is needed so that simultaneous changes to the same entity can be reconciled consistently by all the computers that share that object.
One previous solution to the problem designates a single computer in the network as a lock manager. The lock manager acts as a lock server to which the client computers in the network send their changes. The lock manager serializes the changes to ensure an orderly state change for shared entities. This solution is not entirely satisfactory. Not only is the lock manager a bottleneck in the processing of transactions through the network, but the computer acting as the lock manager must incorporate complex failsafe technology to prevent total shutdown of the network due to the failure of the lock server.
Other solutions focus on distributed locking protocols. A distributed locking protocol requires the implementation of a messaging protocol to handle the locking of the shared entity and to coordinate the changes among the computers so that the changes are applied in the proper order. While a distributed locking protocol does not rely on a designated computer to provide locking, only one computer in the network at a time manages the messaging protocol and so is subject to the same limitations as the lock manager solution.
Therefore, there is a need in the art for a mechanism that allows the distribution of the state change decision process among the interested computers, and which does not depend upon locking to ensure the proper ordering of the changes.
The above-mentioned shortcomings, disadvantages and problems are addressed by the present invention, which will be understood by reading and studying the following specification.
When multiple nodes in a computer network perform work on a shared entity, such as a database record, an arbitration process is used to ensure changes made by more than one node to the same data is propagated to each of the nodes holding the shared entity and that the changes are applied in the same order on each of the nodes. An arbitration cycle for a particular entity is begun on a node (xe2x80x9cinstigatorxe2x80x9d) when the node broadcasts a proposal message for a change to the entity to the other nodes or when the node (xe2x80x9cobserverxe2x80x9d) receives such a proposal message. Multiple nodes can be instigators during a single arbitration cycle. Each node that receives a proposal message sends a response message to the corresponding instigator. The arbitration cycle is closed to additional proposal messages after one instigator has received responses from all the nodes that share the entity. After each instigator node receives all the proposals in the arbitration cycle, it determines whether it is the winner of the arbitration cycle and broadcasts a closure message if it is. Each node determines an order in which to apply the changes proposed in the arbitration cycle when it knows it has received all the proposals in the arbitration cycle as determined by the sending or receiving of the closure message. Because each arbitration cycle is associated with a particular entity, multiple arbitration cycles associated with different items can be running concurrently in the network but multiple arbitration cycles for the same item must be executed serially. The arbitration process is executed even if there is only one proposal made in an arbitration cycle since the arbitration process enables the orderly propagation of changes across all the nodes.
A particular implementation of the arbitration logic in conjunction with an in memory database that provides coherent caching among networked database client computers is disclosed.
The arbitration process of the present invention sends the changes as part of the messages required for synchronization and also provides for a much richer solution to the problem of asynchronous changes, e.g., rejecting certain changes, ordering changes, etc. depending on the type of entity being changed. Furthermore, a centralized lock service is not required as each computer in the network individually makes the determination of how to change the entity within its own cache.
The present invention describes systems, clients, servers, methods, and computer-readable media of varying scope. In addition to the aspects and advantages of the present invention described in this summary, further aspects and advantages of the invention will become apparent by reference to the drawings and by reading the detailed description that follows.